<?
 require("users.php");
 /*
  * 
						<? if($results) :?>
						<dl>
							<? foreach ($variable as $key => $value): ?>
							
								<dt><?=$key?></dt>
								<dd><?=$value?></dd>
							<? endforeach; ?>
							
						</dl>
						<? endif; ?>	 	
  * 
  */

 $results = getUsers();
?>
<!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title><?=$title ?> Customer List</title>
         <? require('../inc/header-info.php'); ?>
    </head>
    <body>
        <div class="container">
            <? include('../inc/nav.php'); ?>
            <form> 
			<table class="table">
    			<caption><h4>NP Commerce Customer Accounts</h4></caption>
    			<thead>
    				<tr>
    					<th>Customer ID</th>
    					<th>Last Name</th>
    					<th>First Name</th>
    					<th>Middle Name</th>
    					<th>Options</th>
    				</tr>
    			</thead>
    			<tbody>
    				<? while($row = $results->fetch_assoc()): ?>
    					<tr>
							<td><?=$row['id']?></td>
							<td><?=$row['last_name']?></td>
							<td><?=$row['first_name']?></td>
                            <td><?=$row['middle_name']?></td>
                            <td>
                            	<a href="<?=$url?>users/edit.php?id=<?=$row['id']?>"><button class="btn btn-mini btn-primary" type="button">Edit</button></a>
                            	<a href="<?=$url?>users/index.php?id=<?=$row['id']?>"><button class="btn btn-mini btn-primary" type="button">Delete</button></a>
                            </td>
                        </tr>
                    <? endwhile; ?>

    			</tbody>
    		</table>
    		</form> 
		</div>
	</body>
</html>

